package com.ruoyi.web.tdm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.tdm.mapper.TdmPeiFangKeLiMapper;
import com.ruoyi.web.tdm.domain.TdmPeiFangKeLi;
import com.ruoyi.web.tdm.service.ITdmPeiFangKeLiService;

/**
 * 配方颗粒Service业务层处理
 * 
 * @author ly
 * @date 2022-03-11
 */
@Service
public class TdmPeiFangKeLiServiceImpl implements ITdmPeiFangKeLiService 
{
    @Autowired
    private TdmPeiFangKeLiMapper tdmPeiFangKeLiMapper;

    /**
     * 查询配方颗粒
     * 
     * @param id 配方颗粒主键
     * @return 配方颗粒
     */
    @Override
    public TdmPeiFangKeLi selectTdmPeiFangKeLiById(Long id)
    {
        return tdmPeiFangKeLiMapper.selectTdmPeiFangKeLiById(id);
    }

    /**
     * 查询配方颗粒列表
     * 
     * @param tdmPeiFangKeLi 配方颗粒
     * @return 配方颗粒
     */
    @Override
    public List<TdmPeiFangKeLi> selectTdmPeiFangKeLiList(TdmPeiFangKeLi tdmPeiFangKeLi)
    {
        return tdmPeiFangKeLiMapper.selectTdmPeiFangKeLiList(tdmPeiFangKeLi);
    }

    /**
     * 新增配方颗粒
     * 
     * @param tdmPeiFangKeLi 配方颗粒
     * @return 结果
     */
    @Override
    public int insertTdmPeiFangKeLi(TdmPeiFangKeLi tdmPeiFangKeLi)
    {
        tdmPeiFangKeLi.setCreateTime(DateUtils.getNowDate());
        return tdmPeiFangKeLiMapper.insertTdmPeiFangKeLi(tdmPeiFangKeLi);
    }

    /**
     * 修改配方颗粒
     * 
     * @param tdmPeiFangKeLi 配方颗粒
     * @return 结果
     */
    @Override
    public int updateTdmPeiFangKeLi(TdmPeiFangKeLi tdmPeiFangKeLi)
    {
        tdmPeiFangKeLi.setUpdateTime(DateUtils.getNowDate());
        return tdmPeiFangKeLiMapper.updateTdmPeiFangKeLi(tdmPeiFangKeLi);
    }

    /**
     * 批量删除配方颗粒
     * 
     * @param ids 需要删除的配方颗粒主键
     * @return 结果
     */
    @Override
    public int deleteTdmPeiFangKeLiByIds(Long[] ids)
    {
        return tdmPeiFangKeLiMapper.deleteTdmPeiFangKeLiByIds(ids);
    }

    /**
     * 删除配方颗粒信息
     * 
     * @param id 配方颗粒主键
     * @return 结果
     */
    @Override
    public int deleteTdmPeiFangKeLiById(Long id)
    {
        return tdmPeiFangKeLiMapper.deleteTdmPeiFangKeLiById(id);
    }
}
